<?php

/**
 * This is the model class for table "curahhujanperbulan".
 *
 * The followings are the available columns in table 'curahhujanperbulan':
 * @property integer $chpb_id
 * @property integer $id_kecamatan
 * @property integer $jan_harihujan
 * @property integer $jan_curahhujan
 * @property integer $feb_harihujan
 * @property integer $feb_curahhujan
 * @property integer $mar_harihujan
 * @property integer $mar_curahhujan
 * @property integer $apr_harihujan
 * @property integer $apr_curahhujan
 * @property integer $mei_harihujan
 * @property integer $mei_curahhujan
 * @property integer $juni_curahhujan
 * @property integer $juni_harihujan
 * @property integer $juli_harihujan
 * @property integer $juli_curahhujan
 * @property integer $ags_harihujan
 * @property integer $ags_curahhujan
 * @property integer $sep_harihujan
 * @property integer $sep_curahhujan
 * @property integer $okt_harihujan
 * @property integer $okt_curahhujan
 * @property integer $nov_harihujan
 * @property integer $nov_curahhujan
 * @property integer $des_curahhujan
 * @property integer $des_harihujan
 * @property integer $tahun
 *
 * The followings are the available model relations:
 * @property Kecamatan $idKecamatan
 */
class Curahhujanperbulan extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Curahhujanperbulan the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'curahhujanperbulan';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('id_kecamatan, jan_harihujan, jan_curahhujan, feb_harihujan, feb_curahhujan, mar_harihujan, mar_curahhujan, apr_harihujan, apr_curahhujan, mei_harihujan, mei_curahhujan, juni_curahhujan, juni_harihujan, juli_harihujan, juli_curahhujan, ags_harihujan, ags_curahhujan, sep_harihujan, sep_curahhujan, okt_harihujan, okt_curahhujan, nov_harihujan, nov_curahhujan, des_curahhujan, des_harihujan, tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('chpb_id, id_kecamatan, jan_harihujan, jan_curahhujan, feb_harihujan, feb_curahhujan, mar_harihujan, mar_curahhujan, apr_harihujan, apr_curahhujan, mei_harihujan, mei_curahhujan, juni_curahhujan, juni_harihujan, juli_harihujan, juli_curahhujan, ags_harihujan, ags_curahhujan, sep_harihujan, sep_curahhujan, okt_harihujan, okt_curahhujan, nov_harihujan, nov_curahhujan, des_curahhujan, des_harihujan, tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'idKecamatan' => array(self::BELONGS_TO, 'Kecamatan', 'id_kecamatan'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'chpb_id' => 'Chpb',
			'id_kecamatan' => 'Id Kecamatan',
			'jan_harihujan' => 'Jan Hari Hujan',
			'jan_curahhujan' => 'Jan Curah Hujan',
			'feb_harihujan' => 'Feb Hari Hujan',
			'feb_curahhujan' => 'Feb Curah Hujan',
			'mar_harihujan' => 'Mar Hari Hujan',
			'mar_curahhujan' => 'Mar Curah Hujan',
			'apr_harihujan' => 'Apr Hari Hujan',
			'apr_curahhujan' => 'Apr Curah Hujan',
			'mei_harihujan' => 'Mei Hari Hujan',
			'mei_curahhujan' => 'Mei Curah Hujan',
			'juni_curahhujan' => 'Juni Curah Hujan',
			'juni_harihujan' => 'Juni Hari Hujan',
			'juli_harihujan' => 'Juli Hari Hujan',
			'juli_curahhujan' => 'Juli Curah Hujan',
			'ags_harihujan' => 'Ags Hari Hujan',
			'ags_curahhujan' => 'Ags Curah Hujan',
			'sep_harihujan' => 'Sep Hari Hujan',
			'sep_curahhujan' => 'Sep Curah Hujan',
			'okt_harihujan' => 'Okt Hari Hujan',
			'okt_curahhujan' => 'Okt Curah Hujan',
			'nov_harihujan' => 'Nov Hari Hujan',
			'nov_curahhujan' => 'Nov Curah Hujan',
			'des_curahhujan' => 'Des Curah Hujan',
			'des_harihujan' => 'Des Hari Hujan',
			'tahun' => 'Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('chpb_id',$this->chpb_id);
		$criteria->compare('id_kecamatan',$this->id_kecamatan);
		$criteria->compare('jan_harihujan',$this->jan_harihujan);
		$criteria->compare('jan_curahhujan',$this->jan_curahhujan);
		$criteria->compare('feb_harihujan',$this->feb_harihujan);
		$criteria->compare('feb_curahhujan',$this->feb_curahhujan);
		$criteria->compare('mar_harihujan',$this->mar_harihujan);
		$criteria->compare('mar_curahhujan',$this->mar_curahhujan);
		$criteria->compare('apr_harihujan',$this->apr_harihujan);
		$criteria->compare('apr_curahhujan',$this->apr_curahhujan);
		$criteria->compare('mei_harihujan',$this->mei_harihujan);
		$criteria->compare('mei_curahhujan',$this->mei_curahhujan);
		$criteria->compare('juni_curahhujan',$this->juni_curahhujan);
		$criteria->compare('juni_harihujan',$this->juni_harihujan);
		$criteria->compare('juli_harihujan',$this->juli_harihujan);
		$criteria->compare('juli_curahhujan',$this->juli_curahhujan);
		$criteria->compare('ags_harihujan',$this->ags_harihujan);
		$criteria->compare('ags_curahhujan',$this->ags_curahhujan);
		$criteria->compare('sep_harihujan',$this->sep_harihujan);
		$criteria->compare('sep_curahhujan',$this->sep_curahhujan);
		$criteria->compare('okt_harihujan',$this->okt_harihujan);
		$criteria->compare('okt_curahhujan',$this->okt_curahhujan);
		$criteria->compare('nov_harihujan',$this->nov_harihujan);
		$criteria->compare('nov_curahhujan',$this->nov_curahhujan);
		$criteria->compare('des_curahhujan',$this->des_curahhujan);
		$criteria->compare('des_harihujan',$this->des_harihujan);
		$criteria->compare('tahun',$this->tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}